package com.example.music_mediaplayer.fragment;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.example.music_mediaplayer.R;
import com.example.music_mediaplayer.adapter.MyListViewAdapter;
import com.example.music_mediaplayer.globalvariable.GlobalVariable;



public class QQFragment extends Fragment {
    private View rootView;
    private ListView listView;
    public MyListViewAdapter adapter;
    private Intent intent;
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        if (rootView == null){
            rootView = inflater.inflate(R.layout.fragment_qq,null);
        }
        initView(rootView);
        return rootView;
    }

    public void initView(View rootView){
        listView = (ListView) rootView.findViewById(R.id.song_list);
        adapter = new MyListViewAdapter(getActivity(), GlobalVariable.BaiDuSongList,2);
        listView.setAdapter(adapter);
    }
}
